﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Remoting.Messaging;
using System.Text;
using System.Threading.Tasks;

namespace rmyy.RepositoryFactory
{
    public static class DBSessionFactory
    {
        public static DBSession CreateDBSession()
        {
            DBSession dbSession = CallContext.GetData("dbSession") as DBSession;
            if(dbSession==null)
            {
                dbSession = new DBSession();
                CallContext.SetData("dbSession",dbSession);
            }
            return dbSession;
        }
    }
}
